home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3640 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.2 KB

  1. Path: goanna.cs.rmit.EDU.AU!not-for-mail
  2. From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
  4. Subject: Re: Hungarian notation
  5. Date: 25 Jan 1996 20:28:21 +1100
  6. Organization: Comp Sci, RMIT, Melbourne, Australia
  7. Message-ID: <4e7ifl$et3@goanna.cs.rmit.EDU.AU>
  8. References: <30C40F77.53B5@swsbbs.com> <4bd <4cc2b2$11jq@navajo.gate.net> <4cud8f$gup@news.netvision.net.il> <4dttefINNo29@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960122145028.27524A-100000@clear.cs.byu.edu> <dewar.822407363@schonberg> <Pine.HPP.3.91.960124153551.24374C-100000@zeezrom.cs.byu.edu>
  9. NNTP-Posting-Host: goanna.cs.rmit.edu.au
  10. NNTP-Posting-User: ok
  11. X-Newsreader: NN version 6.5.0 #0 (NOV)
  12.  
  13. Douglas Evan Cook <cookd@cs.byu.edu> writes:
  14. >ADT's are great, but somebody has to make the ADT's, don't they?  And the
  15. >ADT's sure better be able to cross version/module/language/disk boundaries
  16. >- i.e. if you write a DLL, you have to be sure that the types your
  17. >procedure receives are compatible with what you expect; if you save to
  18. >disk in a file format common to multiple programs, you better be able to
  19. >tell how big each item in the file is.  So you can't hide behind the
  20. >"Abstract Data Type" jargon - I know what it is, and they are the same as
  21. >any other data type at least once in the code: where they are
  22. >implemented.
  23.  
  24. About DLLs I will remain silent.
  25. About saving data in a file or shipping it across a network,
  26. I'm not quite sure that I understand the point, or agree with what I
  27. think it means.
  28.  
  29. Suppose there is some package that defines a type Pack.T
  30. where I don't have access to the representation, only the operations.
  31. As long as there is a Pack.T'Write and a Pack.T'Read (forgive me if
  32. I've got the syntax a bit wrong, I'm still learning about Ada 95
  33. streams) *I* don't have to know what the size of an instance of the
  34. type is in the file.  The size appears explicitly nowhere in my code.
  35.  
  36. There are programming languages where appropriate 'pickling' and
  37. 'unpickling' routines can be automatically generated by the compiler.
  38. Indeed, with the aid of rpcgen (see various UNIX "Network Programming
  39. Guide"s) you can even count C as one of these languages.  "save to
  40. XDR stream" and "load from XDR stream" are just two more operations
  41. on the abstract type.
  42.  
  43. If those operations are not provided, that means that the designer
  44. of the ADT doesn't want you to do that.
  45.  
  46. >In M2, the size
  47. >of the data type "CARDINAL" (in C this is unsigned int) is compiler
  48. >dependant (sic).
  49.  
  50. Programming languages which (a) place arbitrary restrictions on integer
  51. sizes and then (b) refuse to tell you in advance what the restrictions
  52. are make life harder than it needs to be.  If I were managing a software
  53. product, anyone who wasn't writing an assembler or something like that
  54. and went around defining CARD16 or CARD32 would be asked coldly but
  55. politely to provide an immediate explanation.  (Perhaps my B6700 background
  56. is still showing:  I think 39 bits + sign is a good size for an integer...)
  57.  
  58. -- 
  59. "conventional orthography is ... a near optimal system for the
  60.  lexical representation of English words." Chomsky & Halle, S.P.E.
  61. Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
  62.